﻿using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace JuCheap.Core.Model
{
    /// <summary>
    /// 产品创建模型
    /// </summary>
    public class ProductCreateRequestDto
    {
        /// <summary>
        /// 分类Id
        /// </summary>
        [Display(Name = "分类Id")]
        [Required(ErrorMessage = "{0}不能为空")]
        public string CategoryId { get; set; }

        /// <summary>
        /// 产品名称
        /// </summary>
        [Display(Name = "产品名称")]
        [Required(ErrorMessage = "{0}不能为空")]
        [MaxLength(200, ErrorMessage = "{0}长度不能超过{1}个字符")]
        public string ProductName { get; set; }

        /// <summary>
        /// 产品编号
        /// </summary>
        [Display(Name = "产品编号")]
        [Required(ErrorMessage = "{0}不能为空")]
        [MaxLength(100, ErrorMessage = "{0}长度不能超过{1}个字符")]
        public string ProductCode { get; set; }

        /// <summary>
        /// 产品描述
        /// </summary>
        [Display(Name = "产品描述")]
        [MaxLength(300, ErrorMessage = "{0}长度不能超过{1}个字符")]
        public string ProductDescription { get; set; }

        /// <summary>
        /// 产品详细信息
        /// </summary>
        [Display(Name = "产品详细信息")]
        public string Contents { get; set; }

        /// <summary>
        /// 零售价
        /// </summary>
        [Display(Name = "零售价")]
        [Required(ErrorMessage = "{0}不能为空")]
        public decimal RetailPrice { get; set; }

        /// <summary>
        /// 销售价
        /// </summary>
        [Display(Name = "销售价")]
        [Required(ErrorMessage = "{0}不能为空")]
        public decimal SalePrice { get; set; }

        /// <summary>
        /// 单位名称
        /// </summary>
        [Display(Name = "单位名称")]
        [Required(ErrorMessage = "{0}不能为空")]
        [MaxLength(20, ErrorMessage = "{0}长度不能超过{1}个字符")]
        public string UnitName { get; set; }

        /// <summary>
        /// 数量
        /// </summary>
        [Display(Name = "数量")]
        [Required(ErrorMessage = "{0}不能为空")]
        public int Quantity { get; set; }

        /// <summary>
        /// 首页显示
        /// </summary>
        [Display(Name = "首页显示")]
        public bool IsShowInHome { get; set; }

        /// <summary>
        /// 是否发布
        /// </summary>
        [Display(Name = "是否发布")]
        public bool IsPublish { get; set; }

        /// <summary>
        /// 排序序号
        /// </summary>
        [Display(Name = "排序序号")]
        public int Sort { get; set; }

        /// <summary>
        /// 产品规格名称
        /// </summary>
        public List<string> SpecNames { get; set; }

        /// <summary>
        /// 产品规格数据
        /// </summary>
        public List<string> SpecValues { get; set; }

        /// <summary>
        /// 产品图片信息
        /// </summary>
        public List<ProductImageDto> Images { get; set; }
    }
}
